
# 现有列表my_list = [10,20,30,40,50]
# 在列表末尾添加一个元素60
# my_list = [10,20,30,40,50]
# my_list.append(60)
# print(my_list)
# 去除列表中所以为2的元素
# print(my_list[2])
# del my_list[2]
# my_list.remove(20)
# my_list.pop()
# 计算列表中所有元素的和\
# sum= 0
# for item in my_list:
#         sum +=item
# print(sum)

# list1 = [1,2,3]
# list2 = [4,5,6]
# list3 = [(i,j) for i in list1 for j in list2 ]
# list3 = [(i,j) for i in list1 for j in list2 if i>=2 and j<=5 ]
# print(list3)

# 使用for循环的嵌套，打印如下图形的*
#    *
#    ***
#   *****
#  *******
# *********

n = 5
for i in range(1,n + 1):
    for j in range(n - i ):
          print(" ", end="")
    for k in range(2 * i - 1):
          print("*", end="")
    print()